package com.socialuni.center.web.serive;


import com.socialuni.center.web.utils.CenterUserUtil;
import com.socialuni.center.web.utils.UnionIdDbUtil;
import com.socialuni.sdk.domain.UserFollowDomain;
import com.socialuni.sdk.model.QO.FollowAddVO;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * @author qinkaiyuan
 * @date 2020-04-10 3:15
 */
@Service
public class FollowService {
    @Resource
    private UserFollowDomain userFollowDomain;

    public void addFlow(FollowAddVO addVO) {
        //有问题，应该关注完刷新前台用户
        Integer mineUserId = CenterUserUtil.getMineUserId();
        Integer userId = UnionIdDbUtil.getUserIdByUid(addVO.getBeUserId());
        userFollowDomain.addFlow(mineUserId, userId);
    }

    public void cancelFollow(FollowAddVO addVO) {
        Integer mineUserId = CenterUserUtil.getMineUserId();
        Integer userId = UnionIdDbUtil.getUserIdByUid(addVO.getBeUserId());
        userFollowDomain.cancelFollow(mineUserId, userId);
    }
}
